#pragma once
#include "regs.h"
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>

// Command type define.
enum CTYPE
{
	Spec,
	Regs,
	Load,
	Imme,
	Float,
	String
};

struct CodeS
{
	word arg2;
	byte arg1, name;
};
struct CodeR
{
	byte r2, r1, rd;
	byte name;
};
struct CodeL
{
	word address;
	byte regd, name;
};
struct CodeI
{
	word addr_l;
	byte addr_h, name;
};
struct CodeF
{
	word argL;
	byte argH, name;
};
struct CodeST
{
	word arg2;
	byte arg1, name;
};

dword loader();
void selector(dword code);
void TypeS(CodeS code);
void TypeR(CodeR code);
void TypeL(CodeL code);
void TypeI(CodeI code);
void TypeF(CodeF code);
void TypeST(CodeST code);